#ifndef WORLDMESH_H_INCLUDED
#define WORLDMESH_H_INCLUDED

#include <sheeplib/math/vec3.h>
#include <string>
#include <vector>
#include <GL/gl.h>
#include "resources/texturemanager.h"
#include "scene/entity.h"

using std::string;
using std::vector;

namespace engine {
		
	namespace map {
		
		using engine::scene::Entity;
		
		struct WorldTriangle {
			string 			m_TextureName;
			uint 			m_Index[3];
			slVec3			m_FaceNormal;
			slVec3			m_PointNormals[3];
			slVec2			m_TexCoords[3];
		};
		
		struct WorldVertex {
			slVec3 m_Pos;
		};
		
		class WorldMesh : public Entity {
			protected:
				vector<WorldVertex> 	m_VertexData;
				vector<WorldTriangle> 	m_TriangleData;
				
			public:
				WorldMesh(const string& name)
				:Entity(name) {}
				
				virtual ~WorldMesh() {}
				
				virtual bool loadMap(const string& filename) = 0;
				virtual void unloadMap() = 0;
				
				virtual void render();
				
				vector<WorldVertex>& getVertexData() { return m_VertexData; }
				
				
		};
	}
}

#endif // WORLDMESH_H_INCLUDED
